-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add verify
feature
#194
Add verify
feature
#194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When building locally a flipper template contract, I am getting this error:
$ ../bin/run.js contract compile flipper --verifiable
Compiling flipper v0.1.0 (/tmp/cargo-contract_CoFkgq/contracts/flipper)
Compiling metadata-gen v0.1.0 (/tmp/cargo-contract_CoFkgq/contracts/flipper/.ink/metadata_gen)
Finished release [optimized] target(s) in 10m 47s
Running `/contract/target/ink/flipper/release/metadata-gen`
[==] Generating bundle
ERROR: Error decoding BuildResult:
}
Caused by:
expected value at line 1 column 1
Error Compiling flipper contract
at ChildProcess.<anonymous> (file://~/Documents/dev/astar/swanky-cli/dist/commands/contract/compile.js:65:36)
I have the same dependencies as the Dockerimage:
- cargo-contract: v4.0.0-rc.1
- rust & toolchain: 1.72
When using the devcontainer I am also facing an error
root ➜ /workspaces/temp_project (main) $ ../bin/run.js contract compile flipper --verifiable
✖ Error Compiling flipper contract
error: ProcessError: [==] Image does not exist. Pulling one from the registry
4.0.0-rc.1: Pulling from paritytech/contracts-verifiable
1f3513f9501d: Pull complete
d2f5b4d64af6: Pull complete
50c38c4856e5: Pull complete
0bf705fe9e85: Pull complete
Digest: sha256:463b910e18793dd1f8f8e1c92ce72f8937892f8b657525573f47ae59545703e1
Status: Downloaded newer image for paritytech/contracts-verifiable:4.0.0-rc.1
ERROR: Docker responded with status code 500: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: waiting for init preliminary setup: read init-p: connection reset by peer: unknown
Error Compiling flipper contract
at ChildProcess.<anonymous> (file:///workspaces/dist/commands/contract/compile.js:65:36)
Does it works well on your side @prxgr4mm3r ? How do you proceed to test it?
.devcontainer/devcontainer.json
Outdated
|
||
"image": "ghcr.io/swankyhub/swanky-cli/swanky-base:swanky3.1.0-beta.0_v2.1.1", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess your are using this feature to execute the official Parity image within the devcontainer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, is the verification working inside your devcontainer?
I am also wondering if these feature must be released once parity supports the |
@ipapandinas It works locally on my machine. I test it this way:
➜ swanky-cli git:(feature/verifiable) ✗ ../swanky-cli/bin/run.js init ../temp_proj
? Which contract template should we use initially? flipper
? What should we name your initial contract? flipper
? What is your name? prxgr4mm3r
? What is your email?
? Do you want to download Swanky Node? Yes
✔ Copying common template files OK
✔ Checking dependencies OK
✔ Copying contract template files OK
✔ Processing templates OK
✔ Installing dependencies OK
✔ Initializing git OK
✔ Downloading Swanky node OK
✔ Writing config OK
🎉 😎 Swanky project successfully initialised! 😎 🎉
➜ swanky-cli git:(feature/verifiable) ✗ cd ../temp_proj
➜ temp_proj git:(master) ✗ ../swanky-cli/bin/run.js contract compile flipper --verifiable
The contract was built in RELEASE mode.
Your contract artifacts are ready. You can find them in:
/home/prxgr4mm3r/RustroverProjects/temp_proj/target/ink/flipper
- flipper.contract (code + metadata)
- flipper.wasm (the contract's code)
- flipper.json (the contract's metadata)
✔ flipper Contract compiled successfully
✔ Moving artifacts OK
✔ flipper contract's TS types Generated successfully
➜ temp_proj git:(master) ✗ ../swanky-cli/bin/run.js contract verify flipper
✔ flipper Contract verified successfully Can you try to build a contract without swanky-cli, just with cargo-contract, and let me know if it works on your side? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured out my build issue and solve it with a fresh install of docker.
I tested your implementation and everything is working as expected, good job!
I just added few comments and I will check again later the design of the build object to make sure of the UX:
{
timestamp: Date.now(),
artifactsPath,
verified: false,
}
.devcontainer/devcontainer.json
Outdated
|
||
"image": "ghcr.io/swankyhub/swanky-cli/swanky-base:swanky3.1.0-beta.0_v2.1.1", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, is the verification working inside your devcontainer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last adjustments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, good job! 🙌
@vsofiya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run the experiment locally and everything seems to be working well (both positive verification (similar steps as already presented in the discussion), and the negative one, when I changed contract code after verifiable build)
No description provided.